﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using WINBASE_TEST;
using WINBASE;
using WINBASE_TEST.Properties;

namespace WINBASE_TEST
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.ApplicationExit += Application_ApplicationExit;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //Initialize Services
            ApplicationService.QueryHelper = new WINBASE.Utils.DBHelper.QueryHelper(Settings.Default.DBConnectionString);

            //Initialize Data
            ApplicationData.InitializeData();

            //Initialize User Interface
            ApplicationObject.InitializeObject();

            //Startup Point
            if (System.Diagnostics.Debugger.IsAttached)
            {
                //Application.Run(WINBASE.ApplicationObject.FrmMain);
                Application.Run(new frmeTest());
            }
            else Application.Run(WINBASE.ApplicationObject.FrmLogin);
        }

        static void Application_ApplicationExit(object sender, EventArgs e)
        {
            //ApplicationService.QueryHelper.ExecSql("UPDATE rclh1 SET StatusCode = @s WHERE TrxNo = @s", "LOT", ApplicationData.LoginTrxNo);
        }
    }
}